home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet multimedia
/
Grafika i zdjecia
/
Edytory grafiki rastrowej i wektorowej
/
Inscape 0.44.1
/
Inkscape-0.44.1-1.win32.exe
/
share
/
extensions
/
txt2svg.pl
< prev
next >
Wrap
Perl Script
|
2006-09-06
|
649b
|
34 lines
#!/usr/bin/perl
# This is a script to render a plain text file into SVG, line by line.
use strict;
use SVG;
use vars qw($VERSION);
$VERSION = '1.00';
my $svg = new SVG;
$svg->comment('Generated by txt2svg');
my $i=0;
while (<>) {
chomp($_);
s/\t/ /g; # Convert tabs into spaces, otherwise we get errors about invalid char
my $text = $svg->text(id => "text_line_$i",
x => 10,
y => 12*(1+$i),
'xml:space' => 'preserve',
style => { 'font' => 'Courier',
'font-family' => 'Courier 10 pitch',
'font-size' => 10,
}
)
->cdata($_);
$i++;
}
print $svg->xmlify();